package com.zdong.hintview;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // 无title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // 全屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY);  //设置窗口的弹出
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hintlayout);
        Button button= (Button) findViewById(R.id.button);
        SharedPreferences sharedPreferences = getSharedPreferences("wel", Context.MODE_APPEND);
        sharedPreferences.edit().putBoolean("isshutdown",false).commit();
        button.setVisibility(View.GONE);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
//        new Thread() {
//            public void run() {
//                try {
//                    /*  10秒后关闭页面*/
//                    sleep(10000);
//                } catch (Exception e) {
//                    e.printStackTrace();
//                } finally {
//                    finish(); // 关闭页面
//                }
//            }
//        }.start();

    }

}
